/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package com.plian.system.service.fr.procurement;

import com.plian.system.dto.fr.procurement.MaterialProcurementDTO;
import com.plian.system.entity.fr.procurement.MaterialProcurement;
import com.plian.system.excel.ImportResult;
import com.plian.system.model.ListResult;
import com.plian.system.model.R;
import com.plian.system.mybatis.base.BaseService;
import com.plian.system.mybatis.support.Query;
import com.plian.system.vo.fr.procurement.MaterialProcurementVO;
import com.plian.system.vo.fr.procurement.ProcurementSummaryVO;
import com.plian.system.vo.report.ReportReturnVO;

import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.concurrent.Future;

/**
 * 大宗物资采购信息表 服务类
 *
 * @author
 * @since 2020-05-15
 */
public interface IMaterialProcurementService extends BaseService<MaterialProcurement> {


    /**
     * 保存 包含子表
     * @param materialProcurement
     * @return
     */
    boolean submit(MaterialProcurement materialProcurement);

    /**
     * 获取detail obj对象
     * @param materialProcurementVO
     * @return
     */
    R<MaterialProcurementVO> getDetailObj(MaterialProcurementVO materialProcurementVO);

    /**
     * 列表接口
     * @param query
     * @return
     */
    ListResult<MaterialProcurementVO> list(Query query);

    /**
     * 汇总表
     * @param materialProcurementDTO
     * @return
     */
    List<ProcurementSummaryVO> summary(MaterialProcurementDTO materialProcurementDTO);

    /**
     * 根据type值 确定统计维度 1填报单位 2采购单位 3采购分类 4采购平台 5采购分类
     * @param materialProcurementDTO
     * @return
     */
    ReportReturnVO typeSummary(MaterialProcurementDTO materialProcurementDTO);

    /**
     *  生成excel文件 并返回文件名  时间戳+"-"+uuid
     * @param query
     * @return
     */
    String exportDetail(Query query);

    /**
     * excel文件下载
     * @param key
     * @param response
     * @param os
     */
    void download(String key, HttpServletResponse response, OutputStream os);

    /**
     * 导入模板下载
     * @param response
     * @param os
     */
    void exportTemplateExcel(HttpServletResponse response, OutputStream os);

    /**
     * 项目信息导入
     * @param progressId
     * @param inputStream
     * @return
     */
    Future<ImportResult> importExcel(String progressId, InputStream inputStream);
}
